import request from './axios.js'
import MockReq from './mockData.js';
console.log(MockReq,'===MockReq')
let debug = true;

const ajax = (url='',method='get',params,header={})=>{
  if(!debug){
    return request({url,method,params,header})
  }else{
    return MockReq(url,method,params,header)
  }
}
/* 
 request({
	 url:'xxxx',
	 method:'get', // 默认get
	 params,
	 header:{

	 }
 })
 */
//登录
export const login = ()=> ajax('/login');
// 获取用户信息
export const getUserInfo  = (params)=> ajax('/my/getUserInfo');
//编辑资料
export const addUserInfo = (params,method='POST')=> ajax('/my/addUserInfo',method,params);
//择偶条件
export const addSpouseCriterion = (params,method='POST')=> ajax('/my/spouseCriterion',method,params);
// 首页列表-
export const getList = ()=> ajax('/homeList');

